<template>
    <div>
        <h1>子组件</h1>
        <p>count值是:{{ number }}</p>
        <button @click="add" >+1</button>
    </div>
</template>

<script>
export default {
    name:'Count',
    props:['number'],
    emits:['update:number'],
    methods:{
        add(){
            this.$emit('update:number',this.number + 1)
        }
    }
}
</script>

<style>

</style>